package edu.gatech.cs4235.group3.exception;

/**
 * A OneTimePadException is an exception used in this program. A OneTimePadException can be handled by the main function 
 * of this program. Each exception has a message key that is used to retrieve the corresponding message out of the message
 * bundle and a list of argument values that are used to format the message with.
 * 
 * For instance, a key might be "mustHaveNNumber" and the Resource Bundle contains the property:
 * 
 * mustHaveNNumber=You must have {0} {1}.
 * 
 * And the arguments supplied are (10, "Apples"), then the system will print out the message:
 * 
 * You must have 10 Apples.
 * 
 * @author Jeffrey Starker
 *
 */
public class OneTimePadException extends Exception {
	
	/**
	 * Default serial version UID.
	 */
	private static final long serialVersionUID = 1L;

	/**
	 * The key of the message.
	 */
	private String key = null;
	
	/**
	 * The values to format the message with.
	 */
	private Object[] values = null;
	
	/**
	 * Creates a OneTimePadException with the following arguments.
	 * 
	 * @param key The message key.
	 * @param values The values to format the message with.
	 */
	public OneTimePadException(final String key, final Object...values) {
		this.key = key;
		this.values = values;
	}
	
	/**
	 * The key of the message.
	 *
	 * @return the key.
	 */
	public String getKey() {
		return key;
	}
	
	/**
	 * The values used to formatting the message.
	 * 
	 * @return The values.
	 */
	public Object[] getValues() {
		return values;
	}

}
